Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses #305291 by moving “read/unread” session state out of session providers/management and into the Sessions view layer via a dedicated model service, making read state UI-local and storage-backed.
Changes:
- Introduces
SessionsListModelServiceto persist and manage UI-only session state (pinned + read) in profile storage. - Removes
setReadfromISessionsProvider/ISessionsManagementServiceand deletes provider implementations/tests for toggling read state. - Updates Sessions UI (list renderer, view actions, title bar widget) to consult the new model service for read/pinned state and to mark sessions read on open/activation.
Show a summary per file
| File | Description |
|---|---|
| src/vs/sessions/sessions.common.main.ts | Ensures the new list model service module is loaded/registered in the Sessions window entrypoint. |
| src/vs/sessions/services/sessions/common/sessionsProvider.ts | Removes provider-level setRead API. |
| src/vs/sessions/services/sessions/common/sessionsManagement.ts | Removes management-level setRead API. |
| src/vs/sessions/services/sessions/browser/sessionsManagementService.ts | Stops marking sessions read in openSession(); removes setRead() plumbing. |
| src/vs/sessions/contrib/sessions/browser/views/sessionsListModelService.ts | Adds storage-backed service for pinned/read session state + cleanup on session removal. |
| src/vs/sessions/contrib/sessions/browser/views/sessionsList.ts | Switches pinned/read handling to the new service; marks sessions read on open/activation; filters by model read state. |
| src/vs/sessions/contrib/sessions/browser/views/sessionsViewActions.ts | Updates “mark read/unread” actions to route through the Sessions view control. |
| src/vs/sessions/contrib/sessions/browser/sessionsTitleBarWidget.ts | Uses the new model service for context keys + unread badge calculation and reactivity. |
| src/vs/sessions/contrib/sessions/test/browser/sessionsListModelService.test.ts | Adds unit tests for the new model service (pin/read, cleanup, storage behavior). |
| src/vs/sessions/contrib/remoteAgentHost/test/browser/remoteAgentHostSessionsProvider.test.ts | Removes provider setRead test coverage. |
| src/vs/sessions/contrib/remoteAgentHost/browser/remoteAgentHostSessionsProvider.ts | Removes provider setRead implementation. |
| src/vs/sessions/contrib/localAgentHost/test/browser/localAgentHostSessionsProvider.test.ts | Removes provider setRead test coverage. |
| src/vs/sessions/contrib/localAgentHost/browser/localAgentHostSessionsProvider.ts | Removes provider setRead implementation. |
| src/vs/sessions/contrib/copilotChatSessions/test/browser/copilotChatSessionsProvider.test.ts | Removes provider setRead test coverage. |
| src/vs/sessions/contrib/copilotChatSessions/browser/copilotChatSessionsProvider.ts | Removes provider setRead implementation. |
| src/vs/sessions/contrib/chat/test/browser/sessionWorkspacePicker.test.ts | Updates mock provider to match interface change (no setRead). |
Copilot's findings
Comments suppressed due to low confidence (1)
src/vs/sessions/contrib/sessions/browser/views/sessionsViewActions.ts:626
- MarkSessionUnreadAction has the same issue as MarkSessionReadAction: it depends on SessionsView being available and silently does nothing otherwise. Prefer updating read state through ISessionsListModelService directly so the command works regardless of view lifecycle.
run(accessor: ServicesAccessor, context?: ISession | ISession[]): void {
if (!context) {
return;
}
const sessions = Array.isArray(context) ? context : [context];
const viewsService = accessor.get(IViewsService);
const view = viewsService.getViewWithId<SessionsView>(SessionsViewId);
for (const session of sessions) {
view?.sessionsControl?.markUnread(session);
}
- Files reviewed: 16/16 changed files
- Comments generated: 6
lszomoru
approved these changes
Apr 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix #305291